<?php

namespace App\Http\Controllers;

use App\Product;
use Illuminate\Http\Request;

class ProductController extends Controller
{
    public function index(Request $request)
    {
        $product = Product::find(1);
        
        dd($product, $request);
//        dd($product->pivot->price);
    }
    
    /**
     * Model binding
     *
     * @param Product $product
     */
    public function getProduct(Product $product)
    {
        // equal Product::find($id)
        dd($product, Product::first());
    }
}
